<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=get_app_inf('appTitle')?> - User Manage</title>
<link href="/templates/Default/BackEnd/css/default.css" rel="stylesheet" type="text/css">
<script language="javascript" src="js/jquery.js"></script>
<script language="javascript" src="js/jquery-validate/jquery.validate.js"></script>
<script language="javascript" src="js/thickbox/thickbox.js"></script>
<link href="js/thickbox/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript">
$().ready(function() {
	
	$("#frmUser").validate({
		rules: {
			
			
			username: {
				required: true,
				minlength: 2
			},
			<? if($rowset['user_id'] == ''){ ?>
			password: {
				required: true,
				minlength: 6
			},
			confirm_password: {
				required: true,
				minlength: 6,
				equalTo: "#password"
			},
			<? } ?>
			email: {
				required: true,
				email: true
			},
			phone: {
				required: true,
				minlength: 6
			},
			level: "required"
		},
		messages: {


			username: {
				required: "Please enter a username",
				minlength: "Your username must consist of at least 2 characters"
			},
			password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 6 characters long"
			},
			confirm_password: {
				required: "Please provide a password",
				minlength: "Your password must be at least 6 characters long",
				equalTo: "Please enter the same password as above"
			},
			phone: {
				required: "Please provide a phone",
				minlength: "Your phone must be at least 6 characters long"
			},
			email: "Please enter a valid email address",
			level: "Please select the level of access"
		}
	});
	
	 
});
</script>

<style type="text/css">

#frmUser label { width: 250px; }
#frmUser label.error, #frmUser input.submit { color:red;margin-left: 10px; }
 
</style> 
</head>

<body style="background-color:#FFF;margin:0">
<div id="container" >
<div id="nav" align="left">
				 <table width="100%"  border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td height="18" align="left" valign="middle">
					<img src="images/icon_home.jpg" width="16" height="15" align="absbottom" /> &nbsp;<strong>Location：</strong> 
                    <a href="<?=url("MBoAdmin","Main")?>">Home</a> > <a href="<?=url('MBoUser','')?>">Office Staff</a> > New Office Staff</td>
				  </td>
				  <td align="right">
				  <a href="#"><img src="images/btn_refresh.jpg" width="46" height="18" border="0"></a> <a href="#"><img src="images/btn_return.jpg" width="46" height="18" border="0"></a>
				  </td>
				  <td width="10"></td>
				  </tr>
                  <tr><td>
                  <div id="operate">			
			  <table width="100%"  border="0" cellspacing="0" cellpadding="0" align="left">
                <tr>
                  <td width="350" align="left">
				  <a href="<?=url($this->_controllerName,'ADD')?>"><img src="images/btn_add.jpg" width="58" height="21" border="0"></a>
				  <a href="#"><img src="images/btn_edit.jpg" width="58" height="21" border="0"></a>
				  <a href="#"><img src="images/btn_del.jpg" width="58" height="21" border="0"></a>
				  <a href="#"><img src="images/btn_statistics.jpg" width="58" height="21" border="0"></a>
				  </td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
              </table>
			</div>
                  </td></tr>
		 </table> 	
  </div>
			
			
			<!--Content Begin-->
		  <div id="content">
          <form action="<?=$action?>" method="post" enctype="multipart/form-data" name="frmUser" id="frmUser">
            <table width="100%"  border="0" cellpadding="2" cellspacing="0">
              <tr>
                <td colspan="2" class="th">Add A Member Of Staff </td>
              </tr>
             
              <tr>
                <td width="17%" class="td">User Name:</td>
                <td width="83%" class="td"><input type="text" name="username" id="username" value="<?=$rowset['username']?>" /> <?=printError('error','username')?></td>
              </tr>
              <tr>
                <td class="td">Password:</td>
                <td class="td"><input type="password" name="password" id="password" /></td>
              </tr>
              <tr>
                <td class="td">Confirm Password:</td>
                <td class="td"><input type="text" name="confirm_password" id="confirm_password" /></td>
              </tr>
              <tr>
                <td class="td">Mobile Number:</td>
                <td class="td"><input type="text" name="mobile" id="mobile" value="<?=$rowset['mobile']?>" /></td>
              </tr>
              <tr>
                <td class="td">Phone Number:</td>
                <td class="td"><input type="text" name="phone" id="phone" value="<?=$rowset['phone']?>" /></td>
              </tr>
              <tr>
                <td class="td">Email Address: </td>
                <td class="td"><input type="text" name="email" id="email" value="<?=$rowset['email']?>" /></td>
              </tr>
              <tr>
                <td class="td">Photograph: </td>
                <td class="td"><input type="file" name="photo" id="photo"  /> 
				<? if($rowset['photo']) echo '<a href="'.get_app_inf('uploadRoot').'/'.$rowset['photo'].'" title="'.$rowset['username'].'" class="thickbox"  >View</a>'; ?>
                </td>
              </tr>
              <tr>
                <td class="td">Description:</td>
                <td class="td"><textarea name="description" id="description" cols="45" rows="5"><?=$rowset['description']?></textarea></td>
              </tr>
              <tr>
                <td class="td">Department:</td>
                <td class="td"><?=$department?></td>
              </tr>
              <tr>
                <td class="td">Office:</td>
                <td class="td"><?=$office?></td>
              </tr>
              <tr>
                <td class="td">Level Of Access: </td>
                <td class="td"><?=$level?></td>
              </tr>
              <tr>
                <td colspan="2" align="center" valign="middle" class="td">
                <?
                if($rowset['user_id'] == ''){
				?>
                <input type="image" name="imageField" id="imageField" src="<?=BACKEND_IMG?>/btn_add.jpg" />
                <?
				}else{
				?>
                <input type="image" name="imageField" id="imageField" src="<?=BACKEND_IMG?>/btn_edit.jpg" />
                <? } ?>
                <input type="hidden" name="token" id="token" value="<?=$token?>" />
                <input type="hidden" name="user_id" value="<?=$rowset['user_id']?>" />
                </td>
              </tr>
              
            </table>
          </form>
  </div>
  
  <!--Content End-->
</div>
</body>
</html>